pub fn main() {
    // &str 字符串字面量
    let str1 : &str = "aabbcc";
    if str1 == "aabbcc" {
        println!("&str 字符串字面量:{}",str1)
    }

    // String对象
    let dog = String::new(); // 创建一个空的字符串对象
    println!("String对象1:{}",dog);
    let dog = String::from("dog"); // 创建一个空的字符串对象
    println!("String对象2:{}",dog);
    let dog = "dog".to_string(); // 创建一个空的字符串对象
    println!("String对象3:{}",dog);

    let mut dog = format!("String对象4:{}","dog");
    dog.push('a');
    dog.push_str("bc");
    println!("{}",dog);
    println!("len:{}",dog.len());

    dog = dog.replace("abc", " def"); // 替换字符
    println!("len:{},dog:{}",dog.len(),dog);
}